<?php


namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Models\user;
use GatewayWorker\Lib\Gateway;

class LoginController extends Controller
{
    public function login()
    {
        $userData = user::getUserById(1);//虚拟登录
        $userData = self::setUserToken($userData);
        self::bindUid($userData['id']);
        self::bindUserData($userData);
        Gateway::sendToClient(self::$client_id,toJson(array('code' => 200, 'data' => $userData)));
    }
}
